<!DOCTYPE html>
<html class="x-admin-sm">

<head>
    {include file="common/head" /}
</head>
<body>
<div class="layui-fluid">
    <div class="layui-row">
        {eq name="type" value="0"}
        <table class="layui-table" lay-even>
            <colgroup>
                <col width="150">
                <col>
            </colgroup>
            <tbody>
            <tr>
                <td>用户ID</td>
                <td>{$info.uid}</td>
            </tr>
            <tr>
                <td>手机号</td>
                <td>{$info.mobile}</td>
            </tr>
            <tr>
                <td>用户头像</td>
                <td><img src="{$info['head_pic']|default='/static/admin/images/img.png'}" style="width: 120px; height: 120px" alt=""></td>
            </tr>
            <tr>
                <td>昵称</td>
                <td>{$info['nickname']}</td>
            </tr>
            <tr>
                <td>推荐码</td>
                <td>{$info.invite_code}</td>
            </tr>
            <tr>
                <td>佣金余额</td>
                <td>{$info.distribut_money|default=0}</td>
            </tr>

            <tr>
                <td>支付宝收款账号</td>
                <td>{$info.alipay_user}</td>
            </tr>
            <tr>
                <td>微信收款账号</td>
                <td>{$info.wechat_user}</td>
            </tr>

            <tr>
                <td>注册来源</td>
                <td>{$info.oauth}</td>
            </tr>
            <tr>
                <td>注册时间</td>
                <td>{$info.create_time|date='Y-m-d H:i:s'}</td>
            </tr>
            <tr>
                <td>最后登陆时间</td>
                <td>{$info.last_login|date='Y-m-d H:i:s'}</td>
            </tr>
            <tr>
                <td>最后登陆IP</td>
                <td>{$info.last_ip}</td>
            </tr>

            <tr>
                <td>状态</td>
                <td>{$info['status']?'正常':'禁用'}</td>
            </tr>
            </tbody>
        </table>
        {/eq}

        {eq name="type" value="1"}
        <table class="layui-table" lay-even>
            <colgroup>
                <col width="150">
                <col>
            </colgroup>
            <tbody>

            <tr>
                <td>身份证前面</td>
                <td id="code_front"><img src="{$info['code_front']|default='/static/admin/images/img.png'}" style="width: 120px; height: 120px" alt=""></td>
            </tr>
            <tr>
                <td>身份证后面</td>
                <td id="code_behind"><img src="{$info['code_behind']|default='/static/admin/images/img.png'}" style="width: 120px; height: 120px" alt=""></td>
            </tr>
            </tbody>
        </table>
        {/eq}

        {eq name="info['real_name_status']" value="0"}
        <div class="layui-form-item">
            <button onclick="setStatus(1)" class="layui-btn" lay-filter="add" lay-submit="">
                实名通过
            </button>
            <button onclick="setStatus(2)" class="layui-btn layui-btn-danger" lay-filter="add" lay-submit="">
                实名拒绝
            </button>
        </div>
        {/eq}
    </div>
</div>

<div id="idbox" style="display: none">

</div>
<script>layui.use(['form', 'layer'],
    function () {
        $ = layui.jquery;
        var form = layui.form,
            layer = layui.layer;

        layer.photos({
            photos:"#code_front",
            anim:5
        });
        layer.photos({
            photos:"#code_behind",
            anim:5
        });
    });

function setStatus(status) {
    if(status==1){
        msg='您确定要【实名通过】吗？'
    }else{
        msg='您确定要【实名拒绝】吗？'
    }

    layer.confirm(msg,function(index){
        //发异步删除数据
        $.ajax({
            type: "POST",
            url: "{:url('realName')}",
            data: {id:'{$info["uid"]}',status:status},
            dataType:'json',
            success: function (result) {
                if(result.code){
                    layer.msg(result.msg,{icon:1,time:1000});
                    xadmin.close();
                    xadmin.father_reload();
                }else{
                    layer.msg(result.msg,{icon:2,time:1000});
                }
            },
            error: function(data) {
                layer.msg(data.msg,{icon:2,time:1000});
            }

        });


    });
}
</script>

</body>

</html>
